package _05Base64的编码与解码;

import java.util.Base64;

public class DemoUrl {
    public static void main(String[] args) {
        //URL编码
        String s = "www.baidu.com";
        String encodeToString = Base64.getUrlEncoder().encodeToString(s.getBytes());
        System.out.println(encodeToString);

        //URL解码
        byte[] decode = Base64.getUrlDecoder().decode(encodeToString);
        System.out.println(new String(decode));
    }
}
